package typejump.commands;

import typejump.Swagger;
import typejump.engine.GameEngine;

public class DevAddSwag implements TextCommand {

	@Override
	public boolean matches(String command) {
		return command.matches("dev add swag(\\s?[0-9]+)?");
	}

	@Override
	public void act(String command) {
		Swagger swag = Swagger.getInst();
		
		command = command.substring("dev add swag".length()).trim();
		if (command.length() > 0) {
			int amount = Integer.parseInt(command);
			swag.increaseMaxSwag(amount);
			GameEngine.addTextEffect("SWAG INCREASED BY " + amount, "dev");
		} else {
			swag.setMaxSwag(1000);
			GameEngine.addTextEffect("MAXSWAG = 1000", "dev");
		}
	}

}
